//
//  EXListCell.m
//  SmallEasyLife
//
//  Created by qianfeng on 15/10/25.
//  Copyright © 2015年 GXK. All rights reserved.
//

#import "EXListCell.h"
#import "UIImageView+WebCache.h"

@interface EXListCell ()
@property (weak, nonatomic) IBOutlet UIImageView *contentImage;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UIButton *collectButton;
@property (weak, nonatomic) IBOutlet UILabel *tagLabel;

@end

@implementation EXListCell
- (IBAction)collectButtonTap:(UIButton *)sender {
}


- (void)setModel:(Event *)model
{
    _model = model;
    [self.contentImage sd_setImageWithURL:[NSURL URLWithString:[model.imgs firstObject]]];
    
    self.titleLabel.text = model.title;
    self.tagLabel.text = model.tag;
    
    
    
}

- (void)awakeFromNib {
    // Initialization code
    UITapGestureRecognizer * gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imageViewTaped:)];
    [self.contentImage addGestureRecognizer:gesture];
    self.contentImage.userInteractionEnabled = YES;
}

- (void)imageViewTaped:(UIGestureRecognizer *)gesture
{
    [self.ownerController performSegueWithIdentifier:@"EXEventSegue" sender:self.model];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
